package cn.edu.dgut.sai.config;

import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.context.annotation.*;
import org.springframework.core.type.AnnotatedTypeMetadata;
import org.springframework.util.ClassUtils;

/**
 * 企业级软件开发-实训课程：Spring Boot 2.x
 *
 * @author 黎志雄
 * 2019-9-17
 *
 * {@link Conditional}注解为Bean的实例化设置条件。只有里面的{@link Condition}的实现类的matches方法返回true时才实例化为Bean
 */
@Configuration
@ConditionalOnAClass(className = "io.undertow.Undertow")
public class UndertowConfiguration {

    @Bean
    public UndertowServletWebServerFactory undertowContainerFactory() {
        return new UndertowServletWebServerFactory();
    }

}
